<?php
/*
 * Copyright 2009, Jeffrey Palm.
 */

/*
 * Any device calls this to get the current song, give a user id.  We
 * send back the track in teh form of multiples line where each line
 * is a key/value pair.
 *
 * INPUT: user
 * OUTPUT: ( track_key '\t' track_value '\n' )*
 */

include 'top.php';

$user   = param('user');

$sql = 'SELECT * FROM `tracks` WHERE `user` = ' . qw($user);
$row = sql_row($sql);

foreach ($row as $k=>$v) {
  if (preg_match('/^\d+$/',$k)) continue;
  echo $k . "\t" . $v . "\n";
}

include 'done.php';

?>